package cc.lzmsh.controller;



import cc.lzmsh.constants.SystemConstants;
import cc.lzmsh.domain.entity.Comment;
import cc.lzmsh.domain.result.Result;
import cc.lzmsh.service.CommentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

/**
 * 评论表(Comment)表控制层
 *
 * @author msh
 * @since 2024-09-19 20:50:08
 */
@RestController
@RequestMapping("/comment")
public class CommentController{
    /**
     * 服务对象
     */
    @Resource
    private CommentService commentService;

    @GetMapping("/commentList")
    public Result CommentList(Long articleId, Integer pageNum, Integer pageSize) {
        return commentService.CommentList(SystemConstants.ARTICLE_COMMENT,articleId,pageNum,pageSize);
    }

    @PostMapping
    public Result addComment(@RequestBody Comment comment) {
        return commentService.addComment(comment);
    }

    @GetMapping("/linkControllerList")
    public Result linkCommentList(Integer pageNum, Integer pageSize){
        return commentService.CommentList(SystemConstants.LINK_COMMENT,null,pageNum,pageSize);
    }
}

